let arrayOfNumber: number[] = [1, 2, 3];
let arrayOfString: string[] = ['x', 'y', 'z'];

let arrayOfNumber2: Array<number> = [1, 2, 3];
let arrayOfString2: Array<string> = ['x', 'y', 'z'];

arrayOfNumber[3] = 4;
arrayOfNumber.push(5);
arrayOfString[3] = '!';
arrayOfString.push('@');

let anything: any = {};
anything.doAnything();
anything = 1;
anything = 'x';
let num2: number = anything;
let str: string = anything;
let z = anything.x.y.z;
z();

let result: unknown;
if (anything.x) {
    result = anything.x();
} else if (anything.x.y) {
    result = anything.x.y();
}
if (typeof result === 'number') {
    result.toFixed();
}

const userInfo: {
    id?: number;
    name?: null | string
} = { id: 1, name: 'Captain' };
userInfo.id?.toFixed();
const myName = userInfo.name?? `my name is ${userInfo.name}`;

function ThrowError(msg: string): never {
    throw Error(msg);
}

function InfiniteLoop(): never {
    while (true) {}
}
